{% extends 'base.html' %}

{% block content %}
<h2>网络笔记本</h2>
<a class="btn btn-primary" href="{{ url_for('new_note') }}">新建</a>
<hr>
<h3>{{ notes|length }} 条笔记: </h3>
{% for note in notes  %}
<div class="alert alert-success">
    <p>{{ note.body|safe }}</p>

    <a class="btn btn-primary" href="{{ url_for('edit_note', note_id=note.id) }}">修改</a>

    <form method="post" action="{{ url_for('delete_note', note_id=note.id) }}">
        {{ form.csrf_token }}
        {{ form.submit(class='btn')}}
    </form>
</div>
{% endfor %}
{% endblock content %}